package com.zhuzhe.blog.system.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.zhuzhe.blog.base.ResponseData;
import com.zhuzhe.blog.system.entity.SysUser;
import com.baomidou.mybatisplus.extension.service.IService;
import com.zhuzhe.blog.system.requestDto.SysUserPageDto;
import com.zhuzhe.blog.system.responseVo.SysUserListVo;

import java.util.List;

/**
 * <p>
 * 用户信息表 服务类
 * </p>
 *
 * @author u53
 * @since 2020-10-13
 */
public interface ISysUserService extends IService<SysUser> {


    /**
     * 根据条件分页查询用户列表
     *
     * @param sysUserPageDto
     * @return com.zhuzhe.blog.base.ResponseData<com.baomidou.mybatisplus.core.metadata.IPage < com.zhuzhe.blog.system.responseVo.SysUserListVo>>
     * @throws
     * @author whh
     * @date 2020/10/21 21:31
     */
    ResponseData<IPage<SysUserListVo>> queryPage(SysUserPageDto sysUserPageDto);

    /**
     * 根据用户id查询当前用户所拥有的角色ids
     *
     * @param id
     * @return com.zhuzhe.blog.base.ResponseData<java.util.List < java.lang.String>>
     * @throws
     * @author whh
     * @date 2020/10/21 21:46
     */
    ResponseData<List<String>> findRoleIdsByid(String id);


    /**
     * 根据用户id删除用户角色
     *
     * @param userId
     * @return com.zhuzhe.blog.base.ResponseData<java.lang.Integer>
     * @throws
     * @author whh
     * @date 2020/10/21 21:59
     */
    ResponseData<Integer> deleteUserRoleByUserId(String userId);

    ResponseData<Integer> saveUserRole(String id, List<String> roleIds);

    /**
     * 通过用户名查询用户信息
     * @param username 用户名
     * @return
     */
    SysUser findByUsername(String username);
}
